This invention relates generally to the operation of computer programs and is particularly directed to the monitoring of the access, or use, of blocks of code during the operation of a computer program and the display in real time of this information.
There are various aids for computer programmers in the design of a computer program. One programming aid makes use of log files which are reports on system performance, system status, and software faults. This approach provides for the graphic analysis of log files to analyze the occurrence of the log file and to possibly determine the cause of the report. An example of this after-the-fact analysis of computer program operation can be found in U.S. Pat. No. 5,847,972. Another programming aid is described in an article entitled xe2x80x9cVisualizing Performance Debugging,xe2x80x9d by Ted Lehr et al. This approach makes use of the Parallel Programming and Instrumentation Environment (PIE) to develop performance-efficient parallel and sequential computations in a multi-processor system. The PIE system affords a visualization approach in computer program performance debugging. Finally, an article entitled xe2x80x9cParaGraph: A Graphical Tuning Tool for Multiprocessor Systems,xe2x80x9d published in the Fujitsu Scientific and Technical Journal, Vol. 29 (1993) Summer, No. 2, by Awikawa et al., describes a system that gathers periodical statistics of the computational and communication load of each processor in a multiprocessor arrangement during program execution. This data is collected in both the higher level of programming language and lower level of implementation, and is presented in a graphic form on a video display to allow a user to determine the best processor load distribution algorithm.
One problem of increasing importance in computer programming not addressed in the aforementioned programming aids is the size of the software product required to operate a system. As system complexities increase, the length and complexity of the program increases. Subsequent improvements to the program involve the writing of additional code. The tendency today is to write too much code without regard for the size of the software program. This tendency has been encouraged by the conventional wisdom that memory is cheap and programmers are expensive. This has led to large, unwieldy, software packages which run inefficiency and are cumbersome to modify or update. In addition, the operation of the device being controlled is also frequently limited by this approach. For example, the modified and expanded computer program becomes more cumbersome and slower to execute, typically resulting in an increased response time of the hardware carrying out the software-controlled operation. As the limits of computer storage capacity are approached, the computer components must be replaced with newer hardware.
The present invention addresses these problems encountered in the prior art by monitoring the running of selected blocks of software code and presenting this information in real time on a video display to allow for the determination of how frequently selected blocks of code are being accessed and conversely which blocks of code are not being accessed and can be deleted from the program.
This invention contemplates the monitoring of blocks of software code in a computer program to determine (1) how often a block of code is being run, (2) if a block of code is no longer being run, and (3) if new blocks are being run. This permits unused codes to be identified and deleted from the program thus allowing the program to run more efficiently and saving memory for other applications. This information is presented on a video display in two selectable formats in real time. In a first mode of operation, the times at which a selected block of code is accessed within a given time period is displayed along a horizontal axis and the number of times of access at each time it occurs is represented along a vertical axis in bar graph form. In a second mode of operation, the various monitored blocks of code are displayed along a horizontal axis in a spaced manner and the number of times each of the individual blocks is accessed as the computer program runs is presented in bar graph form vertically.
The invention is implemented in a manner similar to that of an oscilloscope with its voltage/current probes attached at various locations in the circuit under analysis. The present invention employs special lines of code added to each software module being observed which function as probes. There is a one-to-one relationship between the software probes and the blocks of code. Every time a given block of code is run, a counter is incremented. The contents of the various counters each corresponding to a block of code are processed and presented on the video display. The contents of the counters are reset as determined by the sweep parameters and the stop and start selectors. Parameter settings such as horizontal sweep, event triggering, and vertical scale are examined first, and are then combined with the data recorded for determining how the data is to be displayed. The display is operated in a manner typical of a Microsoft Windows(copyright) application.